Page({
  data: {
    dateLayerVisible: false,
    houseLayerVisible: false,
    houseList: [],
  },
  onLoad() {
    this.gethoselist()
  },
  //获取房屋列表
  async gethoselist() {
    const res = await wx.http.get('house')
    console.log(res);
    this.setData({
      houseList: res.data
    })
  },
  //点击选中房屋触发
  onHouseselect(e) {
    // console.log(e);
    // 获取当前房屋选中项添加到data中
    this.setData({
      houseInfo: e.detail.name,
      houseId: e.detail.id
    })
  },
  openHouseLayer() {
    this.setData({ houseLayerVisible: true })
  },
  closeHouseLayer() {
    this.setData({ houseLayerVisible: false })
  },
  openDateLayer() {
    this.setData({ dateLayerVisible: true })
  },
  closeDateLayer() {
    this.setData({ dateLayerVisible: false })
  },
  goPassport() {
    wx.reLaunch({
      url: '/visitor_pkg/pages/passport/index',
    })
  },
})
